import request from "@/utils/request";
import { ApiRes, BannerItem, GoodsItem, HotItem, BrandItem, HomeProduct, Special } from "@/types/data";
// 获取首页轮播图
export function getBanner () {
  return request<ApiRes<BannerItem[]>>({
    url: '/home/banner',
    method: "get",
  });
}

// 获取新鲜好物
export function getNew () {
  return request<ApiRes<GoodsItem[]>>({
    url: '/home/new',
    method: "get",
  });
}

// 获取人气推荐
export function getHot () {
  return request<ApiRes<HotItem[]>>({
    url: '/home/hot',
    method: "get",
  });
}


// 获取热门品牌
export function getBrand () {
  return request<ApiRes<BrandItem[]>>({
    url: '/home/brand',
    method: "get",
  });
}

// 获取产品列表
export function getGoods () {
  return request<ApiRes<HomeProduct[]>>({
    url: '/home/goods',
    method: "get",
  });
}

export function getSpecial () {
  return request<ApiRes<Special[]>>({
    url: '/home/special',
    method: "get",
  });
}